using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BlawkayMobileLibrary
{
    public static class Circle
    {

        public static bool HasCollisionBetween(Vector2 positionA, float radiusA, Vector2 positionB, float radiusB)
        {
            float distance = 0.0f;
            return HasCollisionBetween(positionA, radiusA, positionB, radiusB, out distance);
        }
        public static bool HasCollisionBetween(Vector2 positionA, float radiusA, Vector2 positionB, float radiusB, out float distance)
        {
            distance = Vector2.Distance(positionA, positionB);
            float fMaxDistance = radiusA + radiusB;

            if (distance < fMaxDistance)
                return true;

            return false;
        }

        public static bool ContainsPoint(Vector2 position, float radius, Vector2 point)
        {
            return HasCollisionBetween(position, radius, point, 0.0f);
        }

    }
}
